package com.xiaohao.communication.neo4j_dao;

import com.xiaohao.communication.neo4j_bean.User;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;

public interface UserNodeDao extends Neo4jRepository<User, Long> {

    /**
     * 通过 用户id  返回   节点对象
     *
     * @param t_id
     * @return
     */
    @Query("match (n {name:{t_id}}) return n")
    public User findObjectByUser_id(@Param("t_id") String t_id);

    /*@Query("MATCH m=(s:Person)-->(e:Email)-->(r:Person) WHERE e.title=~'.*普通发票.*' RETURN m LIMIT 15")
    public User findAllBy();


    @Query("MATCH a=(:公司 {名称:'中航工业集团公司'})-[r*]->() RETURN nodes(a)")
    public User findAllByid(String name);*/
}
